<HTML><HEAD><TITLE>constraints(+SpecList)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ech)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>constraints(+SpecList)</H1>
Directive for declaring SpecList to be CHR constraints
<DL>
<DT><EM>SpecList</EM></DT>
<DD>Sequence of the form Atom/Integer, or Atom/Integer:PrioSpec
</DD>
</DL>
<H2>Description</H2>
   Declares the predicates specified in SpecList as CHR constraints. This 
   allows the predicate to appear in the head of a CHR rule. A constraint
   can be follwed by a priority specification PrioSpec, which can be one of:
<P>
      1. at_lower(++N) 2. at_higher(++N) 3. at_absolute_priority(++N)
<P>
   where N is an integer. This specifies the priority the CHR rules will be
   executed at if the specified constraint is the active constraint.
   at_lower and at_higher specifies that the priority is N lower or higher
   than the default CHR priority, and for at_absolute_priority, it is the
   actual priority. 
<P>
   Note that a predicate declared as a CHR constraint should not appear as
   a normal ECLiPSe predicate. Any such definition of the predicate in the
   user's program would be replaced by the CHR definition.

<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H2>Examples</H2>
<PRE>   :- constraints leq/2.
   :- op(700, xfx, leq).

   X leq Y &lt;=&gt; \+nonground(X), \+nonground(Y) | X @=&lt; Y.
   X leq X &lt;=&gt; true.
</PRE>

</BODY></HTML>
